// import the path module of the node
const path = require('path');

/**
 * path.join([...paths]) usage: joins all given path segments together using the platform-specific
 *                               separator as a delimiter, then normalizes the resulting path.
 *      1. ...paths: A sequence of path segments
 *      2. returns:  normalized path
 * notes:
 *      1. Zero-length path segments are ignored. If the joined path string is a zero-length string
 *      then '.' will be returned, representing the current working directory.
 * 
 *      2. A TypeError is thrown if any of the path segments is not a string.
 */

path.join('/foo', 'bar', 'baz/asdf', 'quux', '..');
// return: '/foo/bar/baz/asdf'

path.join('foo', {}, 'bar');
// Throws 'TypeError: Path must be a string. Recieved {}'  